package com.neuedu.guide;

/**
 * 算数运算符
 */
public class OperationArithmetic {


    /**
     * @param args
     */
    public static void main(String[] args) {
        int numa = 10;
        int numb = 5;
        int numc = 3;

        double numd = 10;

        // CTRL+ALT+L 格式化

        // numa.soutv   + Tab键
        System.out.println("numa = " + numa);
        System.out.println("numb = " + numb);
        System.out.println("numc = " + numc);
        System.out.println("numd = " + numd);

        System.out.println("(numa + numb) = " + (numa + numb));
        System.out.println("(numa - numb) = " + (numa - numb));
        System.out.println("(numa * numb) = " + (numa * numb));
        System.out.println("(numa / numb) = " + (numa / numb));
        System.out.println("(numa / numc) = " + (numa / numc)); // 3
        System.out.println("(numd / numc) = " + (numd / numc)); //   3.33333
        System.out.println("(numa  % numb) = " + (numa % numb));
        System.out.println("(numa  % numc) = " + (numa % numc));  // 1


        // 自增  自减
        int nume = 5;

        //原来的基础上 +1
        nume = nume + 1;
        System.out.println("nume = " + nume); // 6
        nume++;
        System.out.println("nume = " + nume); //7

        nume--;
        System.out.println("nume = " + nume); //6


        --nume;
        System.out.println("nume = " + nume); //5


        //++、-- 放变量之前，则先进行++ 或者 -- 然后再参与其他表达式运算
        int numf = 10;
        int result =  (numf++) * 2;
        System.out.println("numf = " + numf);
        System.out.println("result = " + result);


    }


}
